package cn.wenhaha.common.constant;

/**
 * --------
 *
 * @author ：wyndem
 * @Date ：Created in 2022-04-19 19:40
 */
public enum DataType {

    SALESFORCE("salesforce",0),
    MYSQL("MYSQL",1);


    DataType(String name,Integer index) {
        this.name = name;
        this.index = index;
    }

    public String getName() {
        return name;
    }

    public Integer getIndex() {
        return index;
    }

    public  static DataType getByIndex(Integer index){
        DataType[] values = values();
        for (int i = 0; i < values.length; i++) {
            if(values[i].getIndex() == index){
                return values[i];
            }
        }
        return  null;
    }

    private String name;
    private Integer index;

}
